package router

import (
	v1 "code.oldboyedu.com/studygo/ginStsMgr/api/v1"
	"github.com/gin-gonic/gin"
)

func InitRoute() *gin.Engine {
	r := gin.Default()
	router := r.Group("/api/v1")
	{ //老师类
		router.POST("teacher/add", v1.CreateTea)
		router.GET("teacher/:id", v1.ViewSTId)
		router.GET("teacher/all", v1.ViewST)
		router.DELETE("teacher/:id", v1.DelST)
		router.PUT("teacher/:id", v1.UpdateST)
		//	学生类
		router.POST("stu/add", v1.CreateStu)
		router.GET("stu/all", v1.ViewStu)
		router.GET("stu/:id", v1.ViewStuId)
		router.PUT("stu/:id", v1.UpdateStu)
		router.DELETE("stu/:id", v1.DelStu)
		//	班级类
		router.POST("class/add", v1.CreateClass)
		router.GET("class/all", v1.ViewClasses)
		router.GET("class/:id", v1.ViewClassesId)
		router.PUT("class/:id", v1.UpdateClass)
		router.DELETE("class/:id", v1.DelClasses)
		//	科目类
		router.POST("sub/add", v1.CreateSub)
		router.GET("sub/all", v1.ViewSuId)
		router.GET("sub/:id", v1.ViewSubs)
		router.PUT("sub/:id", v1.UpdateSub)
		router.DELETE("sub/:id", v1.DelSub)
	}
	return r
}
